package com.qf.service.impl;

import com.qf.entity.Student;
import com.qf.entity.vo.StudentVO;
import com.qf.mapper.StudentMapper;
import com.qf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Student findById(Integer id) {
        return studentMapper.findById(id);
    }

    @Override
    public List<Student> findAll() {
        return studentMapper.findAll();
    }

    @Override
    public List<Student> findByKeyword(HashMap<String, Object> map) {
        return studentMapper.findByKeyword(map);
    }

    @Override
    public void add(Student student) {
        studentMapper.add(student);
    }

    @Override
    public void edit(Student student) {
        studentMapper.edit(student);
    }

    @Override
    public void deleteById(int id) {
        studentMapper.deleteById(id);
    }

    @Override
    public int batchDelete(List<Integer> ids) {
        return studentMapper.batchDelete(ids);
    }

    @Override
    public List<StudentVO> findAllStudentAndClassroom() {
        return studentMapper.findAllStudentAndClassroom();
    }

    @Override
    public StudentVO findStudentAndAllSubjectByStuid(int sid) {
        return studentMapper.findStudentAndAllSubjectByStuid(sid);
    }
}
